package tksUint

import (
	"encoding/json"
	. "github.com/bitly/go-simplejson"
)

// arr, _ := js.Get("test").Get("array").Array()
// i, _ := js.Get("test").Get("int").Int()
// ms := js.Get("test").Get("string").MustString()

func MsgToBuf(msg interface{}) ([]byte, error) {
	b, err := json.Marshal(msg)
	if err != nil {
		return nil, err
	}
	return b, nil
}

func BufToMsg(buf []byte) (*Json, error) {
	return NewJson(buf)
}
